{% extends './layout.html' %}

{% block title -%}
{% if tag %}标签 {{tag}} - {% elif cate %}分类 {{cate}} - {% endif %}{{options.title}}
{%- endblock %}

{% block headers -%}
<link rel="canonical"
  href="{{site_url}}/{% if tag %}tag/{{pathname}}{% elif cate %}cate/{{pathname}}{% endif %}{% if pagination.currentPage > 1 %}?page={{pagination.currentPage}}{% endif %}" />
{%- endblock %}

{% block content %}
<section id="page-index">

  {% if tag %}
  <h1 class="intro">标签<a href="{{site_url}}{{ctx.url}}">{{tag}}</a>下的文章</h1>
  {% elif cate %}
  <h1 class="intro">分类<a href="{{site_url}}{{ctx.url}}">{{cate}}</a>下的文章</h1>
  {% endif %}

  {% for post in posts %}
  <article class="post">
    <div class="meta">
      <div>
        <span class="date">{{think.datetime(post.create_time, 'MM月DD, YYYY')}}</span>
      </div>
      <div class="comment">
        <a href="/post/{{post.pathname}}.html#comments">{{post.comment_num}} comments</a>
      </div>
    </div>

    <h1 class="title">
      <a href="/post/{{post.pathname}}.html">{{post.title}}</a>
    </h1>

    <div class="entry-content">
      {{post.summary | safe}}
      <p class="more">
        <a href="/post/{{post.pathname}}.html">阅读全文 »</a>
      </p>
    </div>

  </article>
  {% endfor %}
  {% include "./inc/pagination.html" %}
</section>
{% endblock %}